﻿using TemplatesPrint.DBHelper;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TemplatesPrint.Entitys
{
    [SugarTable("TaskInfoHistory")]
    public class TaskInfoHistoryEntity : BaseEntity
    {
        [SugarColumn(IsPrimaryKey = true)]
        public string  Id { get; set; }

        [SugarColumn(IsNullable = true)]
        public string MsgId { get; set; }

        [SugarColumn(IsNullable = true)]
        public string Source { get; set; }

        [SugarColumn(IsNullable = true)]
        public string Type { get; set; }
        [Navigate(NavigateType.OneToOne, nameof(Type))]//一对一
        public TaskTypeDicEntity TypeDic { get; set; }
        [SugarColumn(IsIgnore = true)]
        public string TypeName { get { return TypeDic.Name; } }

        [SugarColumn(IsNullable = true)]
        public string TemplateInfo { get; set; }
        [SugarColumn(IsNullable = true)]
        public string PrinterInfo { get; set; }
        [SugarColumn(IsNullable = true)]
        public string Data { get; set; }
        [SugarColumn(IsNullable = true)]
        public string Printcopies { get; set; }
        [SugarColumn(IsNullable = true)]
        public string StartTime { get; set; }
        [SugarColumn(IsNullable = true)]
        public string EndTime { get; set; }

        //0 未开始 新建
        //1	进行中
        //2	已完成
        //3	已取消
        //4	已暂停
        //5	异常
        [SugarColumn(IsNullable = true)]
        public string Status { get; set; }
        [Navigate(NavigateType.OneToOne, nameof(Status))]//一对一
        public TaskStatusDicEntity StatusDic { get; set; }
        [SugarColumn(IsIgnore = true)]
        public string StatusName { get { return StatusDic.Name; } }
    

        [SugarColumn(IsNullable = true)]
        public string ExInfo { get; set; }
    }
}
